<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script type="module">
    import jsonp from "./index"
    document.querySelector("input").oninput = async function(){
        const {g=[]} = await jsonp({
            url:"http://www.baidu.com/sugrec",
            params:{
                prod:"pc",
                wd:this.value
            },
            jsonp:"cb"
        });
        document.querySelector("#root").innerHTML = g.map(item=>(
            <p>${item.q}</p>
        )).join("");
    }
</script>
</body>
</html>